package ael.imarkket.Library;

import org.apache.http.protocol.HTTP;


public class Constantes {

	public enum TipoIP {
		DES, PRU, PRE, PRO
	}

	private String	API_CODIFICACION	= HTTP.UTF_8;
	private int		INT_ID_APP			= 1;
	private String	API_PROTOCOL_HTTP	= "http://";
	// private String API_PROTOCOL_HTTPS = "https://";

	// private String API_IP_DES = "192.168.1.36:8000"; // ip portatil casa
	// private String API_IP_DES = "192.168.0.198:8000"; // ip portatil casa foz
	private String	API_IP_DES			= "192.168.2.2:8000";							// ip portatil belkin
	// private String API_IP_DES = "localhost:8000";

	// private String API_IP_DES = "imarkket.net"; // ip portatil casa foz
	private String	API_IP_PRE			= "10.52.128.163:80";							// ip trabajo
	// ip trabajo

	// private String API_IP_PRO = "83.37.86.174:8000"; // raspi publica
	private String	API_IP_PRO			= "192.168.1.69:8000";							// raspi privada
	// PRO interactua.dnsapi.info

	private String	API_URL_BASE		= "/www/app-imarkket/imarkket-web/classes/";
	// private String API_URL_BASE = "/classes/";
	private String	API_FILE			= "select.class.php";

	// Selecciono el modo de trabajo
	private TipoIP	ModoIP				= TipoIP.DES;

	private String	iv					= "fB&YR),lNZ2fmTX3";
	private String	secretkey			= "o{mpmFKAg+o[r3b-";

	public int getID_APP() {
		return this.INT_ID_APP;
	}

	public Constantes() {
	}

	public String getIV() {
		return this.iv;
	}

	public String getsecretkey() {
		return this.secretkey;
	}

	public TipoIP getModoIP() {
		return this.ModoIP;
	}

	public String getAPI_CODIFICACION() {
		return this.API_CODIFICACION;
	}

	public String getAPI_PROTOCOL_HTTP() {
		return this.API_PROTOCOL_HTTP;
	}

	public String getAPI_IP(TipoIP pAPI_IP) {
		switch (pAPI_IP) {
			case DES:
				Logging.getInstance().log(Logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_DES + this.getAPI_URL_BASE() + this.getAPI_FILE());
				return this.API_IP_DES;
			case PRE:
				Logging.getInstance().log(Logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_PRE + this.getAPI_URL_BASE() + this.getAPI_FILE());
				return this.API_IP_PRE;
			case PRO:
				Logging.getInstance().log(Logging.LOG_INFO, "IP: " + this.getAPI_PROTOCOL_HTTP() + this.API_IP_PRO + this.getAPI_URL_BASE() + this.getAPI_FILE());
				return this.API_IP_PRO;
			default:
				Logging.getInstance().log(Logging.LOG_INFO, "IP: DEFAULT");
				return this.API_IP_DES;
		}
	}

	public String getAPI_URL_BASE() {
		return this.API_URL_BASE;
	}

	public String getAPI_FILE() {
		return this.API_FILE;
	}
}